home *** CD-ROM | disk | FTP | other *** search
- <?xml version='1.0'?>
- <xsl:stylesheet
- xmlns:xsl="http://www.w3.org/TR/WD-xsl"
- xmlns="http://www.w3.org/TR/REC-html40"
- result-ns="">
- <!--
- Copyright 1999 Wattle Software
- This XSL stylesheet is based on stylesheet support found in
- Microsoft Internet Explorer 5.
- Use at your own risk!
- -->
-
- <!-- default rule -->
-
- <xsl:template><xsl:apply-templates/></xsl:template>
-
- <!-- root rule -->
- <xsl:template match="/">
- <!-- Build the HTML page -->
- <html>
- <head>
- <!-- Put something useful into the Title -->
- <title><xsl:value-of select="/library/name"/></title>
- </head>
- <body>
- <H1><xsl:value-of select="/library/name"/></H1>
- <H2>Catalog Listing</H2>
- <BLOCKQUOTE>
- <H3>Books:</H3>
- <BLOCKQUOTE>
- <!-- This template selects all the book elements -->
- <xsl:apply-templates select="/library/book"/>
- </BLOCKQUOTE>
- <H3>Journals:</H3>
- <BLOCKQUOTE>
- <!-- This template selects all the journal elements -->
- <xsl:apply-templates select="/library/journal"/>
- </BLOCKQUOTE>
- <H3>Videos:</H3>
- <BLOCKQUOTE>
- <!-- This template selects all the video elements -->
- <xsl:apply-templates select="/library/video"/>
- </BLOCKQUOTE>
- </BLOCKQUOTE>
- </body>
- </html>
- </xsl:template>
-
- <xsl:template match="book">
- <!-- Lets make the title link to the online URL -->
- <EM><A><xsl:attribute name="href">
- <xsl:value-of select="online_url"/>
- </xsl:attribute>
- <xsl:apply-templates select="title"/>
- </A></EM><BR/><BR/>
- <!-- Create a table for the other details -->
- <TABLE BORDER="1" CELLPADDING="10">
- <TR>
- <TD><B>Author(s):</B></TD>
- <TD><xsl:apply-templates select="author"/></TD>
- </TR>
- <TR BGCOLOR="#CCCCFF"> <!-- add a bit of colour :) -->
- <TD><B>Call No:</B></TD>
- <TD><xsl:apply-templates select="callno"/></TD>
- </TR>
- </TABLE><BR/>
- </xsl:template>
-
- <xsl:template match="video">
- <EM><xsl:apply-templates select="title"/></EM><BR/><BR/>
- <!-- Create a table for the details -->
- <TABLE BORDER="1" CELLPADDING="10">
- <TR>
- <TD><B>Director:</B></TD>
- <TD><xsl:apply-templates select="director"/></TD>
- </TR>
- <TR BGCOLOR="#CCCCFF">
- <TD><B>Call No:</B></TD>
- <TD><xsl:apply-templates select="callno"/></TD>
- </TR>
- </TABLE>
- </xsl:template>
-
- <xsl:template match="journal">
- <EM><xsl:apply-templates select="title"/></EM><BR></BR>
- Date of Publication: <xsl:apply-templates select="date"/><BR></BR>
- <TABLE BORDER="1" CELLPADDING="10">
- <TR BGCOLOR="#CCCCFF">
- <TD><B>Call No:</B></TD>
- <TD ALIGN="CENTER"><xsl:apply-templates select="callno"/></TD>
- </TR>
- </TABLE>
- </xsl:template>
-
- <xsl:template match="title">
- <xsl:value-of/> <!-- insert the element content -->
- </xsl:template>
-
- <xsl:template match="first-name">
- <xsl:value-of/>
- </xsl:template>
-
- <xsl:template match="last-name">
- <xsl:value-of/><BR/>
- </xsl:template>
-
- <xsl:template match="name">
- <xsl:value-of/><BR/>
- </xsl:template>
-
- <xsl:template match="date">
- <xsl:value-of/>
- </xsl:template>
-
- <xsl:template match="callno">
- <FONT FACE="courier new">
- <xsl:value-of/>
- </FONT>
- </xsl:template>
-
- </xsl:stylesheet>
-